import http, { RequestParams } from '@/utils/request';

class OrderRequest {
  /**
   * 支付参数接口
   * @param params
   * @constructor
   */
  public static PullWeChatPayment(params: RequestParams) {
    return http.post<IPullWeChatPaymentRes>('wx/v1/order/simpleOrder', params);
  }

  /**
   * 弹窗支付
   * @param params
   * @constructor
   */
  public static PremiumPullWeChatPayment(params: RequestParams) {
    return http.post<IPullWeChatPaymentRes>('wx/v1/order/premiumOrder', params);
  }

  /**
   * 获取订单列表
   * @param params
   * @constructor
   */
  public static GetOrderList(params: RequestParams) {
    return http.get<IListRes<IOrderList>>('wx/v1/order/page', params);
  }

  /**
   * 商户信息修改确认
   * @param params
   * @constructor
   */
  public static BusinessInfoEdit(params: RequestParams) {
    return http.put<null>('wx/v1/order/customerAffirmOrder', params);
  }

  /**
   * 订单详情 订单取消
   * @param params
   * @constructor
   */
  public static SetOrderCancel(params: RequestParams) {
    return http.put<null>('wx/v1/order/cancelOrder', params);
  }

  /**
   * 订单跟踪信息查询
   * @param params
   * @constructor
   */
  public static GetListKlabReportUrl(params: RequestParams) {
    return http.get<string>('wx/v1/order/listKlabReportUrl', params);
  }

  /**
   * 订单跟踪信息查询
   * @param params
   * @constructor
   */
  public static GetOrderTracking(params: RequestParams) {
    return http.get<IOrderTracking[]>('wx/v1/orderOperation/listByOrderId', params);
  }

  /**
   * 获取订单详情
   * @param params
   * @constructor
   */
  public static GetOrderDetail(params: RequestParams) {
    return http.get<IOrderDetailInfo>('wx/v1/order', params);
  }

  /**
   * 订单导出
   * @param params
   * @constructor
   */
  public static GetOrderExportUrl(params: RequestParams) {
    return http.get<string>('wx/v1/order/exportOrder', params);
  }

  /**
   * 计算订单价格
   * @param params
   * @constructor
   */
  public static CalculateOrderPrice(params: RequestParams) {
    return http.post<ICalculateOrderPriceRes>('wx/v1/order/listCalculateData', params);
  }

  /**
   * 提交订单
   * @param params
   * @constructor
   */
  public static CreateOrderSubmit(params: RequestParams) {
    return http.post<IPullWeChatPaymentRes | null>('wx/v1/order/shoppingAddOrder', params);
  }

  /**
   * 根据OriginNo 得到的订单列表
   * @param params
   * @constructor
   */
  public static ListOrderByOriginNo(params: RequestParams) {
    return http.get<IListRes<IOrderList>>('wx/v1/order/pageByOriginNo', params);
  }

  /**
   * 根据批次码originNo返回支付参数
   * @param params
   * @constructor
   */
  public static ScanToPayWaitOrder(params: RequestParams) {
    return http.get<IPullWeChatPaymentRes>('wx/v1/order/scanToPayWaitOrder', params);
  }

  /**
   * 再次购买，获得产品信息
   * @param params
   * @constructor
   */
  public static BuyAgnGetProdInfo(params: RequestParams) {
    return http.get<IBuyAgnGetProdInfoRes>('wx/v1/order/againOrders', params);
  }

  /**
   * 语音订单下单
   * @param params
   * @constructor
   */
  public static SendVoiceOrder(params: RequestParams) {
    return http.post<number>('wx/v1/order/voiceAddOrder', params);
  }
}
export default OrderRequest;
